package com.bajiao.entity.pay.wx;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Map;

@Data
@ApiModel("WxPayResult")
public class WxPayResult {
    /**
     * 订单编号
     */
    @ApiModelProperty(value = "订单编号")
    private String orderNo;
    /**
     * 订单id
     */
    @ApiModelProperty(value = "订单id")
    private String orderId;
    /**
     * 支付的金额
     */
    @ApiModelProperty(value = "支付的金额")
    private BigDecimal payMoney;
    /**
     * 唤起微信支付所需数据
     */
    @ApiModelProperty(value = "唤起微信支付所需数据")
    private Map result;


    public static final class WxPayResultBuilder {
        private String orderNo;
        private String orderId;
        //支付的金额
        private BigDecimal payMoney;
        //唤起微信支付所需数据
        private Map result;

        private WxPayResultBuilder() {
        }

        public static WxPayResultBuilder aWxPayResult() {
            return new WxPayResultBuilder();
        }

        public WxPayResultBuilder orderNo(String orderNo) {
            this.orderNo = orderNo;
            return this;
        }

        public WxPayResultBuilder orderId(String orderId) {
            this.orderId = orderId;
            return this;
        }

        public WxPayResultBuilder payMoney(BigDecimal payMoney) {
            this.payMoney = payMoney;
            return this;
        }

        public WxPayResultBuilder result(Map result) {
            this.result = result;
            return this;
        }

        public WxPayResult build() {
            WxPayResult wxPayResult = new WxPayResult();
            wxPayResult.setOrderNo(orderNo);
            wxPayResult.setOrderId(orderId);
            wxPayResult.setPayMoney(payMoney);
            wxPayResult.setResult(result);
            return wxPayResult;
        }
    }
}
